<body>
<div id="bg" style="display:none;background-color: #ccc;width: 100%;position:absolute;height: 100%;opacity: 0.5;z-index: 1;"></div>
<div style="padding-top: 10%;padding-left:40%;z-index:1;"></div>
</body>
<script>

var targetWin;
var sharedObject = {};
var funcName = "";
function ShowDialog(func) {
	
	funcName = func;
	var obj = new Object();


	obj.operCode="16|-33|-118|94|-12|76|-90|-7|124|-40|100|15|7|-51|125|33|51";//1-CTBOSS-180014  设备导出
	obj.mainLoginName="16|-60|4|-125|-105|125|101|-8|-103|-79|-103|51|52|103|33|-60|-80";//yx_wangbb
	obj.subLoginName="16|-60|4|-125|-105|125|101|-8|-103|-79|-103|51|52|103|33|-60|-80";//yx_wangbb
	obj.appCode="IAP30";		//??????
	obj.operContent="[??????zw_liuqing]?????????????";		//????????
	obj.serverIp="10.1.198.53";		//???????????session?????ip???
  obj.serverPort="8180";	//???????????session?????ip??????????
  obj.sessionId="F71D6FF150908001690A3AACF3A5020A";		//???????????session????????sessionid
 	obj.isBasedOnLogin="false";	//?????????????  true ???? ???false
	obj.busyType="1";				//??????????????????? 1????? 2?????? 3:?????
	obj.systemId="";	//???????????????????????id
	obj.resAcctId="";	//???????????????id
	obj.checkSessionUrl="";//???????????session????????servlet
	obj.svcNum="";
	obj.provinceCode="IT";
	
	
  var returnValue;
	var iWidth=700; //?????????
	var iHeight=480;//????????
	var iTop=(window.screen.height-iHeight-100)/2;
	var iLeft=(window.screen.width-iWidth)/2;
  var winOption='height='+iHeight+',innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=no,resizeable=no,location=no,status=no';
	
	var a1 = navigator.userAgent;
  var yesIE = a1.search(/Trident/i);
	if(window.ActiveXObject || window.attachEvent || yesIE > 0){ //IE
	    alert("ie");
	    returnValue=window.showModalDialog("b.html", obj, "dialogHeight:"+iHeight+"px; dialogWidth:"+iWidth+"px; toolbar:no; menubar:no;  titlebar:no; scrollbars:no; resizable:no; location:no; status:no;left:"+iLeft+"px;top:"+iTop+"px;");
			if(returnValue != null ){
				alert("returnValue==="+returnValue);
			}
			alert("returnValue==="+returnValue);
			
	   // return returnValue;
	    var me = new Object();
	    me.data=returnValue;
	   receiveMsg(me);
    }else{  //??IE
  //      alert("??ie");
        showDiv();
        
        //post???????goldbankServlet.do
				openWindowWithPostRequest(iWidth, iHeight, iTop, iLeft, winOption, obj);

       //var webUrl = "b.html?params="+JSON.stringify(obj).replace(/\"/g,"'");
    	 //targetWin = window.open(webUrl , 'bwindow','height="+iHeight+",width="+iWidth+",top="+iTop+",left="+iLeft+",toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no,modal=yes,alwaysRaised=yes,depended=yes');   	
        //??????????????
			//???html5?????????????????????????
		
			if (window.addEventListener) {
    	//?window???message??????????????
   		 	window.addEventListener('message', receiveMsg, false);
    	}else {
        window.attachEvent('message', receiveMsg);
    	}
    }
  }
  
  function receiveMsg(e){
  	returnValue=e.data;
  	alert(returnValue);
  	console.log(e.data);
  //	alert("returnValue1111111==="+e.data);	
  	/**
			*
			*?????????????????????
			*/
  	if(returnValue !='undefined' && returnValue != ''){
  		//	alert("returnValue2222==="+e.data);	
  			eval(funcName);
  	}
		if(targetWin!=null){
			targetWin.close();
	  	closeDiv();//????????
	  	targetWin = null;
		}
  }
  
  
function openWindowWithPostRequest(iWidth,iHeight,iTop,iLeft,winOption, obj) {
  var winName='bWindow';
  var winURL='http://localhost:8083/uac/web3/jsp/goldbank/goldbank3!goldBankIframeAction.action';//??��??????????action
//  var windowoption='resizable=yes,height=600,width=800?location=0,menubar=0,scrollbars=1';
  
  var form = document.createElement("form");
  form.setAttribute("method", "post");
  form.setAttribute("action", winURL);
  form.setAttribute("target",winName);  
  for (var i in obj) {
    if (obj.hasOwnProperty(i)) {
      var input = document.createElement('input');
      input.type = 'hidden';
      input.name = i;
      input.value = obj[i];
      form.appendChild(input);
    }
  }              
  document.body.appendChild(form);                       
  //????????????????????????????????????��????                 
	targetWin = window.open("" , winName,winOption,'_self'); 
  form.target = winName;
  form.submit();                 
  document.body.removeChild(form);   
  if (window.focus) { 
    targetWin.focus(); 
  }  
 
      
}


ShowDialog("test1()");


function showDiv(){
	document.getElementById('bg').style.display='block';
	 	
}
function closeDiv(){
	document.getElementById('bg').style.display='none';
}

function test1(){
//	alert("test1");	
}
</script>


	
    


